package me.obstsalat.guildera;

import java.io.Serializable;

import org.bukkit.Location;
import org.bukkit.World;

@SuppressWarnings("serial")
public class Location2d  implements Serializable {
	
	private int x;
	private int z;
	
	Location2d(Location l) {
		this.x = l.getBlockX();
		this.z = l.getBlockZ();
	}
	
	Location2d(int cx, int cz) {
		this.x = cx;
		this.z = cz;
	}
	
	public int getX() {
		return this.x;
	}
	
	public int getZ() {
		return this.z;
	}
	
	public Location toLocation(World world, int height) {
		return new Location(world, this.x, height, this.z);
	}
	
	public boolean equal(Location2d l) {
		return (l.getX() == this.x && l.getZ() == this.z);
	}
}	
